﻿@model BrnMall.Web.StoreAdmin.Models.MessageListModel

@section header{
    <title>创意列表</title>
    <link type="text/css" rel="stylesheet" href="/admin_store/css/site.css" />
    <link type="text/css" href="/components/jbox/Skins/Default/jbox.css" rel="stylesheet" />
    <script type="text/javascript" src="/admin_store/scripts/jquery.js"></script>
    <script type="text/javascript" src="/admin_store/scripts/showlist.js"></script>
    <script type="text/javascript" src="/components/jbox/jquery.jBox-2.3.min.js"></script>
}
@section body{
    <h1 class="rightH1">
	微信小程序 &gt; 留言管理 &gt; <span class="rightH1-cur">留言列表</span>
        <div class="right">
            <div class="clear"></div>
        </div>
        <div class="clear"></div>
    </h1>
    <div class="table_top"></div>

    <div class="dataList">
        <table width="100%">
            <thead>
                <tr>
                    <th width="5%">编号</th>
                    <th width="30%">留言标题</th>
                    <th width="30%">商家回复</th>
                    <th width="15%" align="center">留言时间</th>            
                    <th width="5%">状态</th>
                    <th width="15%"align="center">管理操作</th>
                </tr>
            </thead>
            <tbody>
                @foreach (var info in Model.List)
                {
                <tr>
                    <td>@info.Msgid</td>
                    <td><a href="@Url.Action("Check", new { Msgid = info.Msgid, code = "1234" })">@info.MsgTitle</a></td>
                    <td>

                    @if (info.Comment.Length > 20)
                    {
                        <span>@info.Comment.Substring(0, 20) ...</span>
                    }
                    else
                    {
                        <span>@info.Comment</span>
                    }
                    </td>
                    <td align="center">@info.MsgCreateTime.ToShortDateString()</td>
                    <td>
                        @if (info.IsCheck == 1)
                        {
                            <span> 已审核</span>
                        }
                        else if (info.IsCheck == 2)
                        {
                            <span style = "color:red;" > 已拒绝 </span>
                        }
                        else
                        {
                            <span>未审核</span>
                        }
                    </td>
                    <td align="center">
                        <a href="@Url.Action("Check", new { Msgid = info.Msgid, code = "1234" })" class="editOperate">审核</a>
                        <span class="btn-line">|</span>
                        <a href="javascript:" class="editOperate del" data-msgid="@info.Msgid">删除</a>
                    </td>
                </tr>
                }
            </tbody>
        </table>
    </div>

    <div class="table_bottom"></div>
    <script>
        $(function () {
            $(".del").click(function () { deleteMessage($(this).attr("data-msgid"))})
        })

        function deleteMessage(msgid) {
            $.jBox.confirm("您确定删除吗？", "提示", function (v, h, f) {
                if (v == "ok") {
                    var url = "@Url.Action("DeleteMessage")?msgid=" + msgid;
                    window.location.href = url;
                }
            });
        }

    </script>

}
